#import "CTLANManager.h"
@implementation CTLANManager
NSString *const Language_CN_Hans = @"zh-Hans";
NSString *const Language_VI_US = @"vi";
NSString *const Language_MX_US = @"es";
NSString *const Language_IN_US = @"in";
NSString *const Language_EN_CN = @"en";
+ (NSString *)getWebLan {
    NSString *lan = [CTLANManager preferredLanguage];
    if ([lan hasPrefix:Language_VI_US]) {
        lan = @"vi_VN";
    } else if ([lan hasPrefix:Language_CN_Hans]) {
        lan = @"zh_CN";
    }else if ([lan hasPrefix:Language_MX_US]){
        lan = @"es_mx";
    }else if ([lan hasPrefix:Language_IN_US]){
        lan = @"in_ID";
    }else{
        lan = @"en_US";
    }
    return lan;
}
+ (NSString *)getLocal {
    NSString *lan = [CTLANManager preferredLanguage];
    if ([lan hasPrefix:Language_VI_US]) {
        lan = @"vi";
    } else if ([lan hasPrefix:Language_CN_Hans]) {
        lan = @"zh-Han";
    }else if ([lan hasPrefix:Language_MX_US]){
        lan = @"es";
    }else if ([lan hasPrefix:Language_IN_US]){
        lan = @"in";
    }else{
        lan = @"en";
    }
    return lan;
}
+ (NSString *)preferredLanguage{
    NSArray *languages = [NSLocale preferredLanguages];
    NSString *currentLanguage = [languages firstObject];
    return [NSString stringWithString:currentLanguage];
}
@end
